<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .jd {
            position: relative;
            width: 100px;
            height: 50px;
            background-color: pink;
            margin: 0 auto;
        }

        .jd1 {
            position: absolute;
            top: 10px;
            /* 整个小盒子高度是20px */
            right: -20px;
            width: 0;
            height: 0;
            /* 照顾兼容性 */
            line-height: 0;
            font-size: 0;
            border: 10px solid transparent;
            /* border-left: 10px solid pink; */
            border-left-color: pink;

        }
    </style>
</head>

<body>
    <div class="jd">
        <div class="jd1"></div>
    </div>
</body>

</html>